var maxProfit = function(prices){
  if(prices.length === 0 ){
    return 0;
  }
  let maxProfit = 0;
  for(let i = 0 ;i < prices.length-1;i++){
    if(prices[i] < prices[i+1]){
      maxProfit = prices[i+1]-prices[i]
    }
  }
  return maxProfit;
}
